<template>
  <el-dialog :title="!dataForm.id ? '添加属性' : '编辑'" :close-on-click-modal="false" :visible.sync="visible">
    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
      <el-form-item label="输入属性" prop="type">
        <el-input  placeholder=""></el-input>
      </el-form-item>
      <!-- <el-form-item label="分组名称" prop="name">
        <el-input  placeholder=""></el-input>
      </el-form-item> -->
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>

<script>
  import {treeDataTranslate} from '@/utils'

  export default {
    data () {
      return {
        visible: false,
        dataForm: {
          id: '0'
        },
        dataRule: {
          type: [
            { required: true, message: '菜单名称不能为空', trigger: 'blur' }
          ],
          name: [
            { required: true, message: '菜单名称不能为空', trigger: 'blur' }
          ]
        }
      }
    },

    methods: {
      init (id) {
        this.dataForm.id = id || 0
        this.visible = true
        // this.$nextTick(() => {
        //   this.$refs['dataForm'].resetFields()
        // })
      }
    }
  }
</script>

<style lang="scss">

</style>
